<%@page import="java.util.List"%>
<%@page import="cn.yunhe.model.Cate"%>
<%@page import="cn.yunhe.biz.CateBizImpl"%>
<%@page import="cn.yunhe.biz.ICateBiz"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	String cateName= request.getParameter("catename");
	
	ICateBiz cateBiz=new CateBizImpl();
	
	Cate cate= new Cate();
	cate.setCateName(cateName);
	
	boolean flag=cateBiz.addCate(cate);
	List<Cate> list=cateBiz.searchAll();
	
	if(flag){
		session.setAttribute("list", list);
		request.getRequestDispatcher("listcate.jsp").forward(request, response);
	}else{
		response.sendRedirect("addCate.jsp");
	}
	

%>